package com.itheima.xx.service;

import com.itheima.xx.dao.UserMapper;
import com.itheima.xx.pojo.User;
import com.itheima.xx.util.SqlSessionUtil1;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * Description:
 *
 * @author codermao
 * @date 2023/10/28 16:22
 */
public class UserServiceImpl {
    //定义方法接收web层传递参数
    public List<User> queryAllUsersAndRoles(int startIndex, int pageSize) {
        SqlSession session = SqlSessionUtil1.getSession();
        UserMapper userMapper = session.getMapper(UserMapper.class);

        List<User> list =  userMapper.queryAllUsersAndRoles(startIndex,pageSize);

        session.close();
        return list;
    }
}
